package com.mac.Collaborations;

import com.mac.pojo.Collaborations;
import com.mac.service.CollaborationsService;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author 张舜 独家创作
 * version 1.0
 */
@SuppressWarnings({"all"})
public class test {
    CollaborationsService cs = new CollaborationsService();
    Collaborations c = new Collaborations();

    @Test
    public void selectAllCollaborations(){

        c.setCollaborationId(1);
        c.setTitle("重大成果");
        c.setDescription("牛而逼之");
        c.setPartner("lala");
        c.setStartTIme(java.sql.Date.valueOf("2012-12-12"));
        c.setEndTime(java.sql.Date.valueOf("2012-12-12"));
        ArrayList<Collaborations> list = cs.selectAllCollaborations();
        Iterator it = list.iterator();
        while(it.hasNext()){

            System.out.println(it.next());
        }

    }
    @Test
    public void selectCollaborations(){

        c.setCollaborationId(1);
        c.setTitle("重大成果");
        c.setDescription("牛而逼之");
        c.setPartner("lala");
        c.setStartTIme(java.sql.Date.valueOf("2012-12-12"));
        c.setEndTime(java.sql.Date.valueOf("2012-12-13"));
       Collaborations collaboration= cs.selectOneBycollaborationId(c.getCollaborationId());
        System.out.println(collaboration);

    }

}
